package com.qst.crop.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qst.crop.dao.ExportDao;
import com.qst.crop.entity.Export;
import com.qst.crop.entity.Order;
import com.qst.crop.service.ExportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.concurrent.ExecutorService;

@Service
public class ExportServiceImpl implements ExportService {

    @Autowired
    private ExportDao exportDao;
    @Override
    public PageInfo<Export> findExport(Integer pageNum){
        PageHelper.startPage(pageNum,30);
        List<Export> export =  exportDao.findExport();
        PageInfo<Export> exportPageInfo = new PageInfo<>(export);
        //调用dao进行查询
        return exportPageInfo;
    }

    @Override
    public PageInfo<Export> findExportByKeys(String keys,Integer pageNum){
        PageHelper.startPage(pageNum,30);
        List<Export> export =  exportDao.findExportByKeys(keys);
        PageInfo<Export> exportPageInfo = new PageInfo<>(export);
        //调用dao进行查询
        return exportPageInfo;
    }

    @Override
    public int addUpdExpert(Export export){
        return exportDao.addUpdExpert(export);
    }
}
